<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<script type="text/javascript">
function changeValue(element){
	if( element.checked ){
		element.value = 1;
	}else{
		element.value = 0;
	}
}
</script>
<html:form action="/saveGrindDistribution" styleId="mainForm">
	<table border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td>
	  			<table align="center" cellpadding="2" cellspacing="1" border="0" bgcolor="#CCCCC0">
	    			<tr>
						<td class="titulocolumna" align="center"><bean:message key="label.versions.grinddistribution.corn.type"/></td>
						<td class="titulocolumna" align="center"><bean:message key="label.versions.grinddistribution.corn.type.descripcion"/></td>
						<td class="titulocolumna" align="center"><bean:message key="label.versions.grinddistribution.corn.type.origin"/></td>
						<td align="center" class="titulocolumna"><bean:message key="label.versions.grinddistribution.inventory"/></td>
						<td align="center" class="titulocolumna"><bean:message key="label.versions.grinddistribution.unloading"/></td>
					</tr>
					<logic:notEmpty name="GrindDistributionForm" property="grindDistributionViews">
						<logic:iterate id="tiposMaiz" name="GrindDistributionForm" property="grindDistributionViews" indexId="int_i">
							<tr class="<%=((int_i.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
								<td valign="top" align="center"><bean:write name="tiposMaiz" property="code"/></td>
								<td valign="top" align="left"><bean:write name="tiposMaiz" property="description"/></td>
								<td valign="top" align="center"><bean:write name="tiposMaiz" property="cornOrigin"/></td>
								<td valign="top">
									<bean:define id="inventoryValue"><bean:write name="tiposMaiz"  property="inventory"/></bean:define>
									<input type="checkbox" name="grindDistributionViews[<%=int_i.intValue()%>].inventory"  <%=(inventoryValue.equals("1")?"checked":"")%> onclick="changeValue(this);" value="<%=inventoryValue%>"/>
								</td>
								<td align="center" valign="top">
									<bean:define id="deliveredValue"><bean:write name="tiposMaiz"  property="delivered"/></bean:define>
									<input type="checkbox" name="grindDistributionViews[<%=int_i.intValue()%>].delivered"  <%=(deliveredValue.equals("1")?"checked":"")%> onclick="changeValue(this);"  value="<%=deliveredValue%>"/>
								</td>
							</tr>
						</logic:iterate>
					</logic:notEmpty>
					<tr class="etiqueta_campo">
						<td colspan="5" align="center" valign="top">
							<input type="submit" value="Grabar"  class="boton"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</html:form>